<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<html>
<head>
<base href="<%=basePath%>">
<title>Title</title>
<link rel="stylesheet"
	href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
	<div id="app">
		<el-table :data="tableData" style="width: 100%"
			:default-sort="{prop: 'id', order: 'descending'}"<%--按sid倒序排列--%>
    >
		<el-table-column prop="id" label="编号" sortable width="180">
		</el-table-column> <el-table-column prop="name" label="姓名" sortable width="180">
		</el-table-column> <el-table-column prop="dateCreated" label="创建时间" sortable width="180">
		</el-table-column> <el-table-column prop="dateModified" label="修改时间" sortable
			width="180"> </el-table-column> </el-table>
	</div>

	<script type=text/javascript src="src/vue.js"></script>
	<!-- import Vue before Element -->
	<script src="https://unpkg.com/vue/dist/vue.js"></script>
	<!-- import JavaScript -->
	<script src="https://unpkg.com/element-ui/lib/index.js"></script>
	<script type=text/javascript src="/js/jquery.js"></script>
	<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
	<script>

    new Vue({
        el:"#app",
        data:{
        //动态数据
        tableData:[]
        
        },
        methods: {

        },
        
        mounted: function () {
            var _this = this   //很重要！！
            axios.get('nova-web/favorite/findall.html')
                .then(function (res) {
                    console.log(res);
                    _this.tableData = res.data
                })
                .catch(function (error) {
                    console.log(error);
                });
        },
        //ajax:
        // mounted:function () {
        //     var _this = this
        //     $.ajax({
        //         url: '/findall',
        //         type: 'get',
        //         dataType: 'json',
        //         success: function (res) {
        //             _this.tableData=res.data
        //             console.log(res.data)
        //         }
        //     })
        // }
    })
</script>
</body>
</html>
